


Namespace Kardex
Public Class Almacen



 Public Function Combo(ByVal vTodos As Boolean, Optional ByVal vmensaje As String = "Todos") As Entity.Kardex.AlmacenCol
dim objCol as  New entity.Kardex.AlmacenCol
dim obj as  New Data.Kardex.Almacen
objCol = obj.Listar("", _
		-1, _
		"", _
		-1, _
		-1, _
		-1)
 If vTodos Then
                Dim ent As New Entity.Kardex.Almacen( _
                  -1, _
                  vmensaje, _
                  -1, _
                  -1, _
                  -1)
objCol.AddPrimero(ent)
End If
Return objCol
End Function


'***************************


public Function Listar(AlmacenID as integer) as Entity.Kardex.Almacen

dim objEnt as  New entity.Kardex.Almacen
dim obj as  New Data.Kardex.Almacen
return obj.Listar(AlmacenID)

End Function


'***************************



public Function Listar( _
		AlmacenID as Integer, _
		Nombre as String, _
		LocalId as Integer, _
		Estado as Integer, _
		Principal as Integer) _
as  Entity.Kardex.AlmacenCol

dim objCol as  New entity.Kardex.AlmacenCol
dim obj as  New Data.Kardex.Almacen
return obj.listar("", _
		AlmacenID, _
		Nombre, _
		LocalId, _
		Estado, _
		Principal)

End Function


'***************************


public Function Grabar( _
		AlmacenID as Integer, _
		Nombre as String, _
		LocalId as Integer, _
		Estado as Integer, _
		Principal as Integer, _
vUSuario as integer)as  integer

dim _codigo as integer =-1
dim obj as  New Data.Kardex.Almacen
 if AlmacenID=-1 then 
_codigo= obj.insert( "", _
		AlmacenID , _
		Nombre , _
		LocalId , _
		Estado , _
		Principal , _
 vUSuario )
else
_codigo= obj.update( "", _
		AlmacenID , _
		Nombre , _
		LocalId , _
		Estado , _
		Principal , _
 vUSuario )
end if 
return _codigo

End Function


'***************************


public Function Insertar( _
		AlmacenID as Integer, _
		Nombre as String, _
		LocalId as Integer, _
		Estado as Integer, _
		Principal as Integer, _
vUSuario as integer)as  integer

dim _codigo as integer =-1
dim obj as  New Data.Kardex.Almacen
_codigo= obj.insert( "", _
		AlmacenID, _
		Nombre, _
		LocalId, _
		Estado, _
		Principal, _
 vUSuario )
return _codigo

End Function


'***************************


public Function Updatear( _
		AlmacenID as Integer, _
		Nombre as String, _
		LocalId as Integer, _
		Estado as Integer, _
		Principal as Integer, _
vUSuario as integer)as  integer

dim _codigo as integer =-1
dim obj as  New Data.Kardex.Almacen
_codigo= obj.Update( "", _
		AlmacenID , _
		Nombre , _
		LocalId , _
		Estado , _
		Principal , _
 vUSuario )
return _codigo

End Function


'***************************


public Function ELiminar(  AlmacenID as integer,vusuario as integer ,optional vopcion as string="Delete") as integer
dim _codigo as integer =-1
dim obj as  New Data.Kardex.Almacen
_codigo= obj.Eliminar( "vopcion", AlmacenID ,vusuario)
return _codigo

End Function

End Class



end namespace

